package com.beiding.my.common.query;

import com.beiding.my.common.Bo;
import com.beiding.my.common.QuoteExpressionRegistry;

public abstract class InnerCompare extends InnerExpression{
    public InnerCompare(Expression font) {
        super(font);
    }

    @Override
    protected String createExpression(QuoteExpressionRegistry registry, Class<? extends Bo> type, ParamHolderCreator paramHolderCreator, CreateResult createResult) {
        String and = font instanceof InnerConnectorNoBody ? " " : " and ";
        return font.createExpression(registry, type, paramHolderCreator, createResult) + and + createExpressionLocal(registry, type, paramHolderCreator, createResult);
    }

    /***条件合并***/
    public InnerConnectorNoBody and() {
        InnerConnectorNoBody r = new InnerConnectorNoBody(this);
        r.setSymbol("and");
        return r;
    }

    public InnerConnectorNoBody or() {
        InnerConnectorNoBody r = new InnerConnectorNoBody(this);
        r.setSymbol("or");
        return r;
    }

}
